[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
setfillpattern() Select a User-Defined Fill Pattern
#include <graphics.h>
void far setfillpattern(upattern,color);
char far *upattern;
int color;
setfillpattern() allows the user to set a user-defined pattern
instead of using a predefined one. An 8x8 pattern is used, with
'upattern' pointing to an array of 8 bytes used to create the
pattern. Whenever a bit in the pattern byte is set to 1, the
corresponding pixel is drawn. The following fill pattern:
char mypattern[8] = {
0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33
};
translates to:
XX XX
XX XX
XX XX
XX XX
XX XX
XX XX
XX XX
XX XX
'color' can be one of the values or symbolic constants defined in
<graphics.h>; see setpalette().
Returns: Nothing.
-------------------------------- Example ---------------------------------
The following statements fill a pieslice with a user-defined
checkered pattern.
#include <graphics.h>
#include <conio.h>
int gdriver = DETECT;
int gmode;
main()
{
char mypattern[8] = {0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33};
initgraph(&gdriver,&gmode,"");
setfillpattern(mypattern,YELLOW);
pieslice(200,200,0,134,49);
getch();
closegraph();
}
See Also:
getfillsettings()
getfillpattern()
setpalette()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson